@import '../root.scss';

.pipelines {
  display: flex;
  justify-content: space-between;
}

.pipeline {
  width: 100%;
  height: 95%;
  &__metrics {
    padding-top: 5px;
    &-reliability {
      height: 1rem;
      background-color: $metrics-reliability-color;
    }
  }

  &__current {
    padding: 20px;
    min-height: 100px;
    height: calc(100% - 40px);
    border: 5px solid $border-color;
    position: relative;

    &.FAILED {
      animation: blinkRed 1s linear infinite;
    }

    &.SCHEDULED {
      &:after {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        right: 0;
        background-image: -webkit-gradient(linear, 0 0, 100% 100%,
          color-stop(.25, rgba(255, 255, 255, .2)),
          color-stop(.25, transparent), color-stop(.5, transparent),
          color-stop(.5, rgba(255, 255, 255, .2)),
          color-stop(.75, rgba(255, 255, 255, .2)),
          color-stop(.75, transparent), to(transparent)
        );
        animation: move 2s linear infinite;
        z-index: 2;
        background-size: 100px 100px;
      }
    }

    &.RUNNING {
      &:after {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        right: 0;
        background-image: -webkit-gradient(linear, 0 0, 100% 100%,
          color-stop(.25, rgba(255, 255, 255, .2)),
          color-stop(.25, transparent), color-stop(.5, transparent),
          color-stop(.5, rgba(255, 255, 255, .2)),
          color-stop(.75, rgba(255, 255, 255, .2)),
          color-stop(.75, transparent), to(transparent)
        );
        animation: move 2s linear infinite;
        z-index: 2;
        background-size: 100px 100px;
      }
    }
  }

  &__title {
    text-transform: uppercase;
    font-size: 3em;
    &-content {
      color: $font-color;
      cursor: pointer;
    }
  }

  &__overview {
    position: absolute;
    right: 20px;
    top: 20px;
    color: $font-color;
    text-align: right;

    & > div:nth-child(1) {
      font-size: 4em;
    }

    & > div:nth-child(2) {
      font-size: 5em;
    }
  }

  &__commit-info {
    margin: 0.5em 0;
    font-size: 1.3em;
    max-height: 2.5em;
    overflow: hidden;
    color: $font-color;
  }

  &__trigger {
    //position: absolute;
    //left: 20px;
    //bottom: 20px;
    color: $font-color;
    margin-top: 1em;

    & > div:nth-child(1) {
      font-size: 2.5em;
    }

    & > div:nth-child(2) {
      font-size: 1.2em;
    }
  }

  &__history {
    &-build {
      opacity: 0.8;
      display: inline-block;
      height: 30px;
      width: 50px;
      margin-left: 5px;
      margin-top: 5px;
      font-size: 1.2em;
      color: rgba(255,255,255, .8);
      text-align: center;
      line-height: 30px;
      cursor: pointer;
    }
  }

  .jobs {
    margin: 0.5em 0;
    padding-right: 300px;
  }

  .job {
    padding: 10px 5px;
    display: inline-block;
    line-height: 20px;
    height: 20px;

    & > div {
      background-color: rgba(255, 255, 255, .7);
      padding: 2px 10px;
    }
  }
}

.global-error {
  background-color: $alert-color;
  padding: 20px;
  border: 5px solid $border-color;
  margin: 20px;

  pre {
    word-break: break-all;
    white-space: pre-wrap;
  }

}
